#ifndef __HP_OBJ_H__
#define __HP_OBJ_H__

#include "./textobj.h"
#include "../renderobj.h"

class HpObj : public RenderObj
{
public:
	HpObj(string strName, Point pos, float z, Color color);
	~HpObj();

	void SetVisible(bool v);

	void DecreaseLife();
	int GetLifePoint();

	static void GetSize(int& cx, int& cy);

private:
	void LoadBackground(float rect[4], float posZ);
	void LoadLifeVertexs(float rect[4], float posZ);

	void OnTopMostRender(float differTime);
private:
	Color m_color;
	int m_lifepoint;
	unsigned int m_bkglist;
	unsigned int* m_lifelist;

	//contain another obj
	TextObj m_textObj;
};

#endif